﻿using System.Collections.Generic;

using BLL.Services.Books.Listing;

namespace BLL.Services.Books
{
    /// <summary>
    /// 
    /// </summary>
    public interface IBookService
    {
        /// <summary>
        /// Gets the get all books.
        /// </summary>
        /// <value>
        /// The get all books.
        /// </value>
        IEnumerable<Book> GetAllBooks { get; }

        /// <summary>
        /// Gets the books by author.
        /// </summary>
        /// <param name="authorId">The author id.</param>
        IEnumerable<Book> GetBooksByAuthor(int authorId);

        /// <summary>
        /// Gets some books by category.
        /// </summary>
        /// <param name="categoryId">The category id.</param>
        /// <param name="userId">The user id.</param>
        /// <param name="column">The column.</param>
        /// <param name="direction">The direction.</param>
        /// <param name="page">The page.</param>
        /// <param name="size">The size.</param>
        /// <returns></returns>
        IEnumerable<BookShortInfoModel> GetSomeBooksByCategory(
            int categoryId, int userId, string column, int direction, int page = 1, int size = 12);

        IEnumerable<BookShortInfoModel> GetProfileRatedBooks(
           string email, string column, int direction, int currentUserId, int page = 1, int size = 12);
        
        /// <summary>
        /// Gets the book by id.
        /// </summary>
        /// <param name="bookId">The book id.</param>
        Book GetBookById(int bookId);

        /// <summary>
        /// Creates the specified book.
        /// </summary>
        /// <param name="book">The book.</param>
        void Create(Book book);

        /// <summary>
        /// Saves the specified book.
        /// </summary>
        /// <param name="book">The book.</param>
        void Save(Book book);

        /// <summary>
        /// Deletes the specified book id.
        /// </summary>
        /// <param name="bookId">The book id.</param>
        void Delete(int bookId);

        /// <summary>
        /// Validates the book.
        /// </summary>
        /// <param name="bookId">
        /// The book id.
        /// </param>
        /// <param name="name">
        /// The name.
        /// </param>
        /// <param name="authors">
        /// The authors.
        /// </param>
        bool ValidateBook(int bookId, string name, int[] authors);

        /// <summary>
        /// Gets the listing book.
        /// </summary>
        /// <param name="page">The page.</param>
        /// <param name="size">The size.</param>
        /// <param name="column">The column.</param>
        /// <param name="direction">The direction.</param>
        /// <param name="filter">The filter.</param>
        BooksListing GetListingBook(int page, int size, string column, int direction, BookFilter filter);

        /// <summary>
        /// Gets the new books.
        /// </summary>
        IEnumerable<Book> GetNewBooks();

        /// <summary>
        /// Gets the best books.
        /// </summary>
        /// <param name="userId">The user id.</param>
        IEnumerable<BookWithRating> GetBestBooks(int? userId);

        /// <summary>
        /// Gets the related book.
        /// </summary>
        IEnumerable<Book> GetRelatedBook();
    }
}
